Using Github for project management

A brief tutorial

Matthew Crump

10/31/2019

Overview

  1. What is git and github?
  2. Getting started with Github
  3. General tips

Git

Github

Get your free github account

Sign up at https://www.github.com

Download Github Desktop

Download the version for your operating system https://desktop.github.com

Connect Github Desktop to your Github Account

Open Github Desktop, open the Preferences menu, then sign in with your Github Account.

Keeping (g)it simple

Normal folders and git folders

Git folders look like normal folders, but have hidden .git files

#fill: #FEFEFF #lineWidth: 1 #zoom: 4 #direction: right

[ Normal Folder | [Your Computer | [Folder | File 1 | File 2 | etc. ] [Folder] -/- [Properties] [Properties | Not shared | Local | No version control] ] ]

[ Git Folder | [Your Computer | [Git Folder | File 1 | File 2 | Hidden .git files ] [Git Folder] -/- [Properties] [Properties | Not shared | Local | Has version control | Looks like a normal folder] ] ] FALSETRUEFALSEFALSEFALSETRUE

git folders

#fill: #FEFEFF #lineWidth: 1 #zoom: 4 #direction: right [ Git Folder | [Your Computer | [Git Folder | File 1 | File 2 | Hidden .git files ] [Git Folder] -> [Previous Versions] [Previous Versions | [Git Folder v.3 | File 1 | File 2 | Hidden .git files ] [Git Folder v.2 | File 1 | File 2 | Hidden .git files ] [Git Folder v.1 | File 1 | File 2 | Hidden .git files ] [Git Folder v.3] -/- [Git Folder v.2] [Git Folder v.2] -/- [Git Folder v.1] ] ] ] FALSETRUEFALSEFALSEFALSETRUE

Git Folders store history of changes (version control)

git master and branches

#fill: #FEFEFF #lineWidth: 1 #zoom: 4 #direction: right [ Git Folder | [Your Computer | [Git Folder | File 1 | File 2 | Hidden .git files ] [Git Folder] -> [Master (Previous Versions)] [Git Folder] -> [Branch (Previous Versions)] [Master (Previous Versions) | [Git Folder v.3 | File 1 | File 2 | Hidden .git files ] [Git Folder v.2 | File 1 | File 2 | Hidden .git files ] [Git Folder v.1 | File 1 | File 2 | Hidden .git files ] [Git Folder v.3] -/- [Git Folder v.2] [Git Folder v.2] -/- [Git Folder v.1] ] [Branch (Previous Versions) | [Git Folder v.3 | File 1 | File 2 | Hidden .git files ] [Git Folder v.2 | File 1 | File 2 | Hidden .git files ] [Git Folder v.1 | File 1 | File 2 | Hidden .git files ] [Git Folder v.3] -/- [Git Folder v.2] [Git Folder v.2] -/- [Git Folder v.1] ] ] ] FALSETRUEFALSEFALSEFALSETRUE

Can have multiple branches

usually for development purposes

git basics

#fill: #FEFEFF #lineWidth: 1 #zoom: 4 #direction: right [ Git Folder | [Your Computer | [Git Folder v.1 | File 1 | File 2 | Hidden .git files ] [Git Folder v.1] –> [ Make Changes] [ Make Changes] -> [Commit Changes | add descriptive note | records change in version history] [ update to v.2] <- [Commit Changes] [Git Folder v.1] <- [ update to v.2] [Commit Changes] -> [ Save version] [ Save version]->[Version history | [Previous Versions| [v.1] -/- [v.0]]] ] ] FALSETRUEFALSEFALSEFALSETRUE

  • Make changes to files
  • “Commit” the changes
  • git updates current version
  • and saves the previous version

git + github

#fill: #FEFEFF #lineWidth: 1 #zoom: 4 #direction: right

[ git + Github | [Github.com Repository| [Git Folder v.1 | your files] -/- [Version history | [Previous Versions| [v.1] -/- [v.0]]] ] [Your Computer] -> [Push| Send to Github] [Your Computer| [Git Folder v.1 | your files]] [Push] -> [Github.com Repository] [Pull] <- [Github.com Repository] [Pull | Sync from Github | to local] [Your Computer] <- [Pull] [Github.com Repository]-/-[Github Features] [Github Features|share folder online|download as .zip|collaboration tools|website tools|share R packages|OSF integration]] FALSETRUEFALSEFALSEFALSETRUE

  • copy from local to Github.com
  • “push” to Github.com
  • “pull/sync” from Github.com

Looks complicated, but…

Complicated at first but…

  • Relatively easy with Github Desktop
  • Similar to Dropbox, but with commit notes
  • let’s get to some examples…

Create a new git folder from RStudio

Add new repo to Githup Desktop

Github Desktop (view and manage your repos)

Commit then publish

Publishing to Github.com

Viewing your repo on Github.com

Work on your files

Commit new changes in Github Desktop

Publish them to Github (if you want to)

Changes appear on Github.com

That’s Github in a nutshell

Before moving on the next module…

A few more tips

Making new local repos

Cloning and Forking

From Github.com, if you have a Github account

Cloning

Forking

Github Issues

Normally used to report and address “bugs” in software, but can be used as useful way to have discussions (with collaborators or yourself) about project-related tasks:

Github Pages + OSF integration

We’ll talk about Github Pages and OSF (open science framework) integration in later modules. Short story is that: